
<ul class="nav nav-tabs" role="tablist">
  <li{{if $score==1}} class="active"{{/if}}><a href="main.php?act=order_review_list&goods_id={{$goods_id}}&score=1" >差评</a></li>
  <li {{if $score==2}} class="active"{{/if}}><a href="main.php?act=order_review_list&goods_id={{$goods_id}}&score=2">中评</a></li>
  <li {{if $score==3}} class="active"{{/if}}><a href="main.php?act=order_review_list&goods_id={{$goods_id}}&score=3" >好评</a></li>
  
</ul>
{{foreach from=$order_reviews item=list key=key}}
{{$user=$list.user_info}}
<div class="forinr">
  
  <div class="review_ri" style="width:95%">
    <div class="revi_tc"><span class="bluec">{{$user.info.nick_name}}</span> <span>- {{$list.add_time}} </span> 
    <span style="font-size:13px;">
    {{$score=$list.score}}
    {{if $score==3}}<span class="text-success">好评</span>{{else if $score==2}}<span class="text-warning">中评</span>{{else}}<span class="text-danger">差评
</span>{{/if}} 
    </span> 
    <a onclick="$('.reply_{{$key}}').toggle()" class="blue ">回复</a>
    </div>
    <div class="log_content">{{$list.content}}</div>
    <div class="reply_div reply_{{$key}} "  style="display:none">
      <textarea class="reply" id="reply_{{$key}}" name="reply_{{$list.r_id}}"></textarea>
      <input type="button" class="btn_jq" value="回复"  onclick="orderReview('{{$list.r_id}}','{{$key}}')">
    </div>
    {{foreach from=$list.reply item=slist key=skey}}
    <div class="rps">
      {{$u=$slist.user_info.info}}
        <div class="usertimein" style="float:left">{{$u.nick_name}} {{$slist.add_time}}</div>
     
      <div class="rps_content" style="float:left">{{$slist.content}}</div>
    </div>
    {{/foreach}} </div>
</div>
{{/foreach}}

{{include file="../pager.htm"}}

<script>

function orderReview(r_id,key){
	if(user_id*1==0)
	{
		alert('请先登录!');
		window.parent.location.href = 'main.php?act=user_login';
		return false;
	}
	var data = new Object;
	data.user_id = user_id;
	data.user_name = '{{$user_info.user_name}}';
	data.rp_id = r_id;
	data.type = 3;
	data.id = '{{$goods_id}}';
	data.content = $("#reply_"+key).val();
	var da = "act=add_review&data="+$.toJSON(data);
	Main.AJAX("ajax.php",da,orderReviewRes)	
}
function orderReviewRes(res){
	location.href = location.href;	
}

</script>